<?php

// phpMyRealty 3
//
// File Name: menu2.php
// File Location : ./templates/default/
//
// Copyright (c)2009 phpMyRealty.com
//
// e-mail: support@phpMyRealty.com

?>

<!-- Menu : start -->

<?php 

   echo '<a href="' . URL . '" class="topmenu">' . $lang['Menu_Home'] . '</a> | ';

   echo '<a href="' . URL . '/favorites.php" class="topmenu">' . $lang['Favorites_View'] . '</a> | ';

   echo '<a href="' . URL . '/alerts.php" class="topmenu">' . $lang['Alert'] . '</a> | ';

   if ($conf['rewrite'] == 'ON')
    echo '<a href="' . URL . '/search.html" class="topmenu">' . $lang['Menu_Search'] . '</a> | ';
   else
    echo '<a href="' . URL . '/advsearchform.php" class="topmenu">' . $lang['Menu_Search'] . '</a> | ';

   if ($conf['rewrite'] == 'ON')
    echo '<a href="' . URL . '/calculator.html" class="topmenu">' . $lang['Mortgage_Calculator'] . '</a> | ';
   else
    echo '<a href="' . URL . '/calculator.php" class="topmenu">' . $lang['Mortgage_Calculator'] . '</a> | ';
         
   if ($conf['rewrite'] == 'ON')
    echo '<a href="' . URL . '/contacts.html" class="topmenu">' . $lang['Realtor_Search'] . '</a>';
   else
    echo '<a href="' . URL . '/usersearch.php" class="topmenu">' . $lang['Realtor_Search'] . '</a>';

   $menuCol = str_replace('name', 'menu', $language_in);
   $sql = 'SELECT menu, '.$menuCol.', id, string FROM ' . PAGES_TABLE.' WHERE status = 1';
   $r_pages = $db->query($sql);

   while ($f_pages = $db->fetcharray($r_pages))
   {
       $menu = $f_pages[$menuCol];
       if (strlen(trim($menu)) == 0) {
           $menu = $f_pages['menu'];
       }

       if ($conf['rewrite'] == 'ON') {
           $url = $f_pages['string'];
           if (strlen(trim($url)) == 0) {
               echo ' | <a href="' . URL . '/Article/' . $f_pages['id'] . '.html" class="topmenu">' . $menu . '</a>';
           } else {
               echo ' | <a href="' . URL . '/Pages/' . $url . '.html" class="topmenu">' . $menu . '</a>';
           }
       } else {
            echo ' | <a href="' . URL . '/pages.php?id=' . $f_pages['id'] . '" class="topmenu">' . $menu . '</a>';
       }
   }
   $db->freeresult($r_pages);

?>
<?php

  echo ' | <a href="' . URL . '/rss.php" target="new"><img src="' . URL . '/templates/' . $cookie_template . '/images/xml.gif" alt="RSS Feed" border="0" /></a>';

?>


<!-- Menu : stop -->
